Hi, |
Re: Linking between two modules by bypassing an intermediate module. |
Re: Linking between two modules by bypassing an intermediate module. I'd use the Wizard to make a two-level from C to B, open the column and copy the code to Notepad-C. Then I'd make another one in B from A, again copy the code to another Notepad-B. Embrace Notepad-B in a function, perhaps "void GetLinksToB(Object o)". In Notepad-C replace the recursive "showIn(othero, depth+1)" with a call to "GetLinksToB(othero)", and I don't think you need the rest of the loop in Notepad-C. Copy GetLinksToB from Notepad-B to the top of Notepad-C and the text of Notepad-C into a layout column in module B. Easier said then done, but there's no getting around that fact that your code must first follow outlinks to B, and then following Inlinks to A. The other method would be to make a one-level wizard in B inlinks from A, then convert that layout into an attrDXL, maybe called dxlAlinks. Then create a one-level wizard in C outlinks to B, and select attribute dxlAlinks for display. Either method will produce duplicates: if object C1 goes to B1 and B2, and if both B1 and B2 goes to A1, then you get a duplicate reference to A1 displayed for object C1. The solution for that is to use the first method, but define a global Skip list with Key 'Object' oA and Data 'string' whatever info you want from A. When you find an A then try to put it in the Skip list, and if successful remove if from the skip, calculate its display (ID, etc), then re-insert it. The other method would be to hire me for a week so I can do 20 minutes worth of work for you.
|
Re: Linking between two modules by bypassing an intermediate module. llandale - Thu Oct 01 18:30:46 EDT 2009
A few year ago I wrote a little layout DXL script which can recursively follow links in specified (and differing) directions down to a user-defined level. The include file is attached. For your specific example, you would call it as follows: (note that for the actual case it is a bit overkill, as Louie correctly mentioned it would take a short time only to write script which loops over outgoing links in Module A, and incoming links in Module B; while the attached script is more general). Anyway, here you go:
#include <../include/links.inc>
// The level of recursion is defined by the number of elements of the arrays below,
// in this example we go down two levels
string LnkMod[] = {"*", "*"}
// Or specify the names of your link modules, if required
string ModName[] = {"Module B", "Module C"}
// I assume you want to create the view in Module A, hence you have to go to Module B first, and
// then to Module C
bool inComing[] = {false, true}
// At the first level you have outgoing links, then incoming links
// Create a Skip list containing the linked objects
Skip linkSkip = followLinks(obj, 0, LnkMod, ModName, inComing)
// Now you define which attributes you want to display at each level
// Make sure you define one string array per recursion level and add it to the
// Skip list
Skip attSkip = create
// I assume you only want to display the Object Text from Module C, so at the
// first level (Module B) you display nothing
string a0[] = {""}
// And a the second level you display Object Text
string a1[] = {"Object Text"}
// You could add more attributes in the array if necessary, or plain text or rich text
// elements to format the output, e.g.
// string a1[] = {"{\\b ", "Object Text", "}: ", "Last modified on"}
put(attSkip, 0, a0)
put(attSkip, 1, a1)
// Get the Skip list with the display strings
Skip dispSkip = linkedAtts(linkSkip, attSkip)
// Display elements
// You could add a second Skip list here in order to remove duplicates
string disp
for disp in dispSkip do {displayRich disp}
// Delete all Skip lists
delete_skip linkSkip
delete attSkip
delete dispSkip
Attachments attachment_14301254_links.inc |
Re: Linking between two modules by bypassing an intermediate module. i think that things can be more easy if your links are all il same direction : A <---- B and B <---- C Pierre |
Re: Linking between two modules by bypassing an intermediate module. 1. In module B, do an in-link analysis from C. 2. Convert your Layout DXL column in 1 above to an attribute DXL using "Convert Layout DXL to Attribute DXL". 3. From A, do an out-link analysis to B, and display the results of the attribute DXL created in 2 above. No DXL coding required using this technique. |